import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    uid: sessionStorage.getItem('uid'),
    islogin: sessionStorage.getItem('islogin')//定义是否已登录状态
  },
  mutations: {
    addUserId(state, value) {
      state.userList.push(value)
    },
    loginOK(state, value) {
      state.islogin = true
      state.uid = value
      sessionStorage.setItem('islogin', true)
      sessionStorage.setItem('uid', value)
    }
  },
  actions: {
  },
  modules: {
  }
})
